/**   
 * 文件名：ReplyVO.java</br>
 * 描述： </br>
 * 开发人员：汪浩博 </br>
 * 创建时间： 2016-5-20
 */ 

package com.post.bean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.base.util.BeanUtil;
import com.user.bean.BBSUser;
import com.user.service.UserService;

/** 
 * 类名: ReplyVO</br> 
 * 包名：com.post.bean </br> 
 * 描述: </br>
 * 发布版本号：</br>
 * 开发人员： 汪浩博</br>
 * 创建时间： 2016-5-20 
 */

public class ReplyVO implements Serializable{
	private String id;			//id
	private String userId;		//�û�id
	private String postId;		//帖子id
	private String content;		//����
	private String replyTime;	//�ظ�ʱ��
	private Integer pageNum;		//����ҳ��
	private Integer floor;		//����¥��
	
	private Long uid;			//用户id
	private String nickName;	//昵称
	private String headImg;
	
	public List<ReplyVO> beanTransVo(List<Reply> queryResult,UserService userService){
		ArrayList<ReplyVO> list = new ArrayList<ReplyVO>();
		for (Reply reply : queryResult) {
			String userId = reply.getUserId();
			BBSUser bbsUser = userService.findUserById(userId);
			ReplyVO replyVO = new ReplyVO();
			//属性拷贝
			BeanUtil.copyProperties(replyVO, reply);
			replyVO.setUid(Long.parseLong(userId));
			replyVO.setNickName(bbsUser.getNickName());
			replyVO.setHeadImg(bbsUser.getHeadImg());
			
			list.add(replyVO);
		}
		return list;
	}
	
	
	
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getUserId() {
		return userId;
	}
	public void setUserId(String userId) {
		this.userId = userId;
	}
	public String getPostId() {
		return postId;
	}
	public void setPostId(String postId) {
		this.postId = postId;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getReplyTime() {
		return replyTime;
	}
	public void setReplyTime(String replyTime) {
		this.replyTime = replyTime;
	}
	public Integer getPageNum() {
		return pageNum;
	}
	public void setPageNum(Integer pageNum) {
		this.pageNum = pageNum;
	}
	public Integer getFloor() {
		return floor;
	}
	public void setFloor(Integer floor) {
		this.floor = floor;
	}
	public Long getUid() {
		return uid;
	}
	public void setUid(Long uid) {
		this.uid = uid;
	}
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	public String getHeadImg() {
		return headImg;
	}
	public void setHeadImg(String headImg) {
		this.headImg = headImg;
	}	 
	
}
